-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate partially supported callables #7446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e2aae61
to
3af29f1
Compare
I would like to make the language better and I have a proposal for a long time: make a new spelling to indicate the method and consider it the only correct one.
Line
interpret as
Pros:
Perhaps, if it was positively accepted by the community, it would open up possibilities such as specifying a typehint for Closure. And also, by analogy, you can make an indication of properties of class, having received the above described advantages.
|
@ta-tikoma This sounds like https://wiki.php.net/rfc/first_class_callable_syntax, which is part of PHP 8.1. |
that's right, I'm wrong, with a different interpretation |
abc9252
to
9270e48
Compare
9270e48
to
0ca1a69
Compare
Is it true this removes the ability to make deferred calls in those forms listed from PHP entirely? I totally get the bottom two being removed as they're pretty nonsensical, but the top 6 don't currently have any other way of representing them, even if it's "often" undesired behaviour it might not be and seems odd to remove such a dynamic way of referencing a method call from a pretty dynamic language just because it might not be what people intended... |
@ElvenSpellmaker Please see https://wiki.php.net/rfc/deprecate_partially_supported_callables#backward_incompatible_changes for suggested alternative spellings. If by "deferred calls" you mean passing |
Is there any easy way to figure out where these calls are being made? We're trying to get a working PHP 8.2 build for Laravel but we can't figure out where all the failures from this PR are coming: https://github.com/laravel/framework/runs/8183443527?check_suite_focus=true |
This deprecates callables that are accepted by
call_user_func($callable)
but not$callable()
:RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables